//
//  XZHReadTableViewCell.m
//  Piece
//
//  Created by dllo on 16/6/11.
//  Copyright © 2016年 Northeast Dianli University. All rights reserved.
//

#import "XZHReadTableViewCell.h"

@implementation XZHReadTableViewCell
- (void)setModel:(XZHIllustrationModel *)model
{
    if (_model != model) {
        _model = model;
        if ([model.type  isEqual: @"serialcontent"]) {
            model.type = @"serial";
        }
        NSString *imageName = [NSString stringWithFormat:@"read_%@", model.type];
        self.leftImageView.image = [UIImage imageNamed:imageName];
        //self.titlesLabel.text = model.title;
        
        NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] initWithString:model.title];
        
        NSRange range = [model.title rangeOfString:self.strKey];
        [attributeString setAttributes:[NSMutableDictionary dictionaryWithObjectsAndKeys:[UIColor redColor], NSForegroundColorAttributeName, nil] range:range];
        self.titlesLabel.attributedText = attributeString;
        
     }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
